﻿<%@ Page Title="" Language="C#" MasterPageFile="~/admin/Admin.master" AutoEventWireup="true" CodeFile="AdminManager.aspx.cs" Inherits="admin_Home" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
    <style type="text/css">
        .style1
        {
            color: white;
        }
        .style2
        {
            color: red;
        }
    .style3
    {
        color: yellow;
    }
        .style4
        {
            color: #FFFFFF;
            width: 121px;
        }
        .style5
        {
            width: 121px;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <p>
        <asp:MultiView ID="MultiView1" runat="server">
            <asp:View ID="View1" runat="server">
                <asp:GridView ID="GridView1" runat="server" AllowPaging="True" 
                    AutoGenerateColumns="False" BackColor="White" BorderColor="#999999" 
                    BorderStyle="Solid" BorderWidth="1px" CellPadding="3" DataKeyNames="adminID" 
                    ForeColor="Black" GridLines="Vertical" 
                    onpageindexchanging="GridView1_PageIndexChanging" 
                    onrowdeleting="GridView1_RowDeleting" 
                    onselectedindexchanging="GridView1_SelectedIndexChanging" Width="820px" 
                    EmptyDataText="No Record Found!">
                    <AlternatingRowStyle BackColor="#CCCCCC" />
                    <Columns>
                        <asp:BoundField DataField="adminID" HeaderText="ID" Visible="False" />
                        <asp:BoundField DataField="NO" HeaderText="No">
                        <HeaderStyle ForeColor="Yellow" CssClass="text_right"/>
                        <ItemStyle Width="5px" CssClass="text_right"/>
                        </asp:BoundField>
                        <asp:BoundField DataField="adminName" HeaderText="Name">
                        <HeaderStyle CssClass="text_left" ForeColor="Yellow" />
                        <ItemStyle CssClass="text_left" Width="210px" />
                        </asp:BoundField>
                        <asp:BoundField DataField="username" HeaderText="Username">
                        <HeaderStyle ForeColor="Yellow" CssClass="text_left"/>
                        <ItemStyle Width="110px" CssClass="text_left"/>
                        </asp:BoundField>
                        <asp:BoundField DataField="pass" HeaderText="Pass" Visible="False" />
                        <asp:BoundField DataField="email" HeaderText="Email">
                        <HeaderStyle ForeColor="Yellow" CssClass="text_left"/>
                        <ItemStyle Width="325px" CssClass="text_left"/>
                        </asp:BoundField>
                        <asp:BoundField DataField="tel" HeaderText="Tel">
                        <HeaderStyle ForeColor="Yellow" CssClass="text_left"/>
                        <ItemStyle Width="150px" CssClass="text_left"/>
                        </asp:BoundField>
                        <asp:TemplateField>
                            <ItemTemplate>
                                &nbsp;<asp:ImageButton ID="ImageButton1" runat="server" CausesValidation="False" 
                                    CommandName="Delete" ImageUrl="~/img/delete.gif" 
                                    onclientclick="return confirm('Are you sure?')" />
                            </ItemTemplate>
                            <ItemStyle Width="20px" />
                        </asp:TemplateField>
                    </Columns>
                    <FooterStyle BackColor="#CCCCCC" />
                    <HeaderStyle BackColor="Black" Font-Bold="True" ForeColor="White" />
                    <PagerStyle BackColor="#999999" ForeColor="Black" HorizontalAlign="Center" />
                    <SelectedRowStyle BackColor="#000099" Font-Bold="True" ForeColor="White" />
<%--                    <SortedAscendingCellStyle BackColor="#F1F1F1" />
                    <SortedAscendingHeaderStyle BackColor="#808080" />
                    <SortedDescendingCellStyle BackColor="#CAC9C9" />
                    <SortedDescendingHeaderStyle BackColor="#383838" />--%>
                </asp:GridView>
                <asp:LinkButton ID="btnNewAdmin" runat="server" Font-Underline="True" 
                    onclick="btnNewAdmin_Click" ForeColor="White">New Admin</asp:LinkButton>
                <br />
            </asp:View>
            <asp:View ID="View2" runat="server">
                <table border="0" width="780">
                    <tr>
                        <td colspan="2">
                            <div align="right">
                                <span class="style3" style="font-size: 22px; "><strong>New Administrator</strong></span></div>
                        </td>
                    </tr>
                    <tr>
                        <td class="style4">
                            <div align="right">
                                UserName:</div>
                        </td>
                        <td style="text-align: left">
                            &nbsp;<asp:TextBox ID="TextBox1" runat="server" BackColor="LightBlue" Width="228px"></asp:TextBox>
                            <span style="color:Red">
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator7" runat="server" 
                                ControlToValidate="TextBox1" ErrorMessage="UserName is required!">(*)</asp:RequiredFieldValidator>
                            </span>
                            <asp:Button ID="btnCheckUser" runat="server" CausesValidation="False" 
                                OnClick="btnCheckUser_Click" TabIndex="100" Text="CheckUser" Width="85px" />
                            <asp:Label ID="lblCheckUserName" runat="server" ForeColor="Red"></asp:Label>
                        </td>
                    </tr>
                    <tr style="color: #000000">
                        <td class="style4">
                            <div align="right">
                                Password:</div>
                        </td>
                        <td style="text-align: left">
                            &nbsp;<asp:TextBox ID="TextBox2" runat="server" BackColor="LightBlue" 
                                TextMode="Password" Width="228px"></asp:TextBox>
                            <span style="color:Red">
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
                                ControlToValidate="TextBox2" ErrorMessage="Password is required!">(*)</asp:RequiredFieldValidator>
                            </span>
                        </td>
                    </tr>
                    <tr style="color: #000000">
                        <td class="style4">
                            <div align="right">
                                Repeat password:
                            </div>
                        </td>
                        <td style="text-align: left">
                            &nbsp;<asp:TextBox ID="txtRePass" runat="server" BackColor="LightBlue" Style="left: 25px;
                            top: -1px" TextMode="Password" Width="228px"></asp:TextBox>
                            <span style="color:Red">
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" 
                                ControlToValidate="txtRePass" ErrorMessage="Repeat pass is required!">(*)</asp:RequiredFieldValidator>
                            <asp:CompareValidator ID="CompareValidator1" runat="server" 
                                ControlToCompare="TextBox2" ControlToValidate="txtRePass" 
                                ErrorMessage="Retype password is not match!" Height="19px" 
                                Style="left: -22px; position: relative; top: 0px">(*)</asp:CompareValidator>
                            </span>
                        </td>
                    </tr>
                    <tr>
                        <td class="style4">
                            <div align="right">
                                Email:</div>
                        </td>
                        <td style="text-align: left">
                            &nbsp;<asp:TextBox ID="TextBox3" runat="server" BackColor="LightBlue" Width="228px"></asp:TextBox>
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" 
                                ControlToValidate="TextBox3" CssClass="style2" ErrorMessage="Email is required">(*)</asp:RequiredFieldValidator>
                            <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" 
                                ControlToValidate="TextBox3" CssClass="style2" ErrorMessage="Email not match!" 
                                Style="left: -22px; position: relative; top: 0px" 
                                ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*">(*)</asp:RegularExpressionValidator>
                        </td>
                    </tr>
                    <tr>
                        <td class="style4">
                            <div align="right">
                                Repeat email:
                            </div>
                        </td>
                        <td style="text-align: left">
                            &nbsp;<asp:TextBox ID="txtReEmail" runat="server" BackColor="LightBlue" Style="left: 39px;
                            top: -2px" Width="228px"></asp:TextBox>
                            <asp:CompareValidator ID="CompareValidator2" runat="server" 
                                ControlToCompare="TextBox3" ControlToValidate="txtReEmail" CssClass="style2" 
                                ErrorMessage="Retype email is not match!" Style="left: 4px;
                            position: relative; top: -1px">(*)</asp:CompareValidator>
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" 
                                ControlToValidate="txtReEmail" CssClass="style2" 
                                ErrorMessage="Repeat email is required!" Style="left: -18px; position: relative;
                            top: -1px">(*)</asp:RequiredFieldValidator>
                            &nbsp;
                        </td>
                    </tr>
                    <tr>
                        <td class="style4">
                            Full name:
                        </td>
                        <td style="text-align: left">
                            &nbsp;<asp:TextBox ID="TextBox4" runat="server" BackColor="LightBlue" Style="left: 39px;
                            top: -2px" Width="228px"></asp:TextBox>
                            <span style="color:Red">
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator8" runat="server" 
                                ControlToValidate="TextBox4" ErrorMessage="Name is required!">(*)</asp:RequiredFieldValidator>
                            </span>
                        </td>
                    </tr>
                    <tr>
                        <td class="style4">
                            Phone:</td>
                        <td style="text-align: left">
                            &nbsp;<asp:TextBox ID="TextBox6" runat="server" BackColor="LightBlue" Style="left: 39px;
                            top: -2px" Width="228px"></asp:TextBox>
                            &nbsp;
                            <asp:RegularExpressionValidator ID="RegularExpressionValidator2" runat="server" 
                                ControlToValidate="TextBox6" CssClass="style2" 
                                ErrorMessage="Phone is . or - or number" ValidationExpression="[\d \.\-]*">(*)</asp:RegularExpressionValidator>
                        </td>
                    </tr>
                    <tr>
                        <td class="style5">
                            <div align="right">
                            </div>
                        </td>
                        <td style="text-align: left">
                            <asp:ValidationSummary ID="ValidationSummary1" runat="server" ForeColor="Red" />
                        </td>
                    </tr>
                    <tr>
                        <td class="style5">
                        </td>
                        <td style="text-align: left">
                            &nbsp;<asp:Button ID="btnRegister" runat="server" OnClick="btnRegister_Click" 
                                Text="Register" Width="77px" />
                            <asp:Button ID="btnReset" runat="server" CausesValidation="False" 
                                OnClick="btnReset_Click" Text="Clear" Width="77px" />
                            <asp:Button ID="btnCancel2" runat="server" CausesValidation="False" 
                                OnClick="btnCancel_Click" Text="Back" Width="75px" />
                        </td>
                    </tr>
                </table>
            </asp:View>
            <br />
        </asp:MultiView>
    </p>

    <script language="javascript" type="text/javascript">
        $(document).ready(function () {
            $("#ctl00_ContentPlaceHolder1_GridView1").tablesorter();
        });
    </script>
</asp:Content>

